package com.kk.xhr.model.dao.custom;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 自定义签到mapper
 *
 * @author kkmystery
 * @version 1.0 2021/3/29
 * @since 1.0.0
 */
@Mapper
public interface SignCustomMapper {

    @Select("SELECT COUNT(*) FROM sign\n" +
        "WHERE sign_date >= #{begin} and sign_date <= #{end} and STATUS = 1 \n" +
        "GROUP BY sign_date")
    List<Long> queryWeekRecord(@Param("begin") LocalDateTime begin, @Param("end") LocalDateTime end);
}
